﻿namespace Aldart.WebSockets.Server
{
    using System;

    /// <summary>
    /// Exception raised when a sent or received request is invalid.
    /// </summary>
    [Serializable]
    public class InvalidRequestException : Exception
    {
        /// <summary>
        /// Initializes a new instance of the InvalidRequestException class.
        /// </summary>
        public InvalidRequestException() { 
        }

        /// <summary>
        /// Initializes a new instance of the InvalidRequestException class.
        /// </summary>
        /// <param name="message">A string describing the exception.</param>
        public InvalidRequestException(string message) : base(message) { 
        }

        /// <summary>
        /// Initializes a new instance of the InvalidRequestException class.
        /// </summary>
        /// <param name="message">A string describing the exception.</param>
        /// <param name="inner">Inner exception.</param>
        public InvalidRequestException(string message, Exception inner) : base(message, inner) { 
        }

        /// <summary>
        /// Initializes a new instance of the InvalidRequestException class. Required for serialization.
        /// </summary>
        /// <param name="info">Serialization info.</param>
        /// <param name="context">Streaming context.</param>
        protected InvalidRequestException(
          System.Runtime.Serialization.SerializationInfo info,
          System.Runtime.Serialization.StreamingContext context)
            : base(info, context) { 
        }
    }
}
